#include "stm32f10x.h"   
#include "delay.h"
#include "QDTFT_demo.h"
#include "Lcd_Driver.h"
#include "Tim2.h"
#include "UltrasonicWave.h"
#include "GUI.H"

extern char distance[20];
void dis_display()
{
	LCD_LED_SET;      //通过IO控制背光亮	
	Gui_DrawFont_GBK16(7,30,RED,GRAY0,"the distance is");
  Gui_DrawFont_GBK16(50,70,BLUE,GRAY0,distance);
	//LCD_LED_CLR;             //IO控制背光灭	
}

int main(void)
{ 
	delay_init(72);
	Lcd_Init();
	//初始化定时器2
	TIM2_Configuration();
	// 初始化超声波模块
	UltrasonicWave_Configuration();
	Lcd_Clear(GRAY0);
	while(1)
	{// 来到这里的时候，系统的时钟已经被配置成72M。
		dis_display();
		UltrasonicWave_StartMeasure();
	}
}

